import uuid

from CloudEngine.core.VTActor import VTActor
from Connector.client import res_success


class CmdRenderHighlightReset:
    name = "cmd_render_highlight_reset"
    id = uuid.uuid4()

    def __init__(self, service, Params, Tag, Type):
        self.service = service
        self.params = Params
        self.tag = Tag
        self.type = Type

    async def execute(self):
        ac: VTActor = self.service.get_first_actor()
        ac.reset_cell_color()
        line_ac = self.service.get_second_actor()
        d3_ac = self.service.get_third_actor()
        if line_ac:
            line_ac.reset_cell_color()
        if d3_ac:
            d3_ac.reset_cell_color()
        self.service.render()
        await res_success(self.tag, self.type, {"status": "ok"})
